Current Location: Home> Function Categories> cos

cos

Cosine
Name:cos
Category:math
Programming Language:php
One-line Description:Cosine.

Definition and usage

cos() function returns the cosine of a number.

Example

In this case, we will calculate the cosines of different values:

 <?php
echo ( cos ( 3 ) ) ;
echo ( cos ( - 3 ) ) ;
echo ( cos ( 0 ) ) ;
echo ( cos ( M_PI ) ) ;
echo ( cos ( 2 * M_PI ) ) ;
?>

Try it yourself

grammar

 cos ( x )
parameter describe
x Required. A number.

illustrate

cos() returns the cosine value of the parameter x . The unit of parameter x is radians.

Similar Functions
Popular Articles